#include "thread.h"
#include <QMutexLocker>
Thread::Thread(QMainWindow* parent)
    :QThread(parent)
{

}

//void Thread::run()
//{
//    for(int i = 0;i<10;i++)
//    {
//        sleep(1);
//        emit notify();
//    }
//}

int Thread::num = 0;
QMutex Thread::mutex;

void Thread::run()
{
    for(int i = 0;i<5000;i++)
    {
        QMutexLocker mutexLocker(&mutex);
        //mutex.lock();
        num++;
        //mutex.unlock();
    }
}
